package com.itheima.string;

public class StringBuilderDemo1 {
    public static void main(String[] args) {
        StringBuilder sb = new StringBuilder();

        /*
        * 因为StringBuilder是Java写好的类，打印该对象不显示地址值，而是属性值
        * */
        System.out.println(sb);

        sb.append("abc");
        sb.append(1);
        sb.append(2.3);
        sb.append(true);

        System.out.println(sb);

        // 修改原内容
        sb.reverse();
        System.out.println(sb);

        String str = sb.toString();
        System.out.println(str.substring(2,5));
    }
}
